<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
       var sum = 0;
       var average = 0;
       for (var i = 1; i <= 100 ; i++){
           sum = sum + i;
       }
       average = sum / 100;
       console.log(average);

       var even = 0;
       var odd = 0;
        for(var i = 1 ; i <= 100; i++)
        {
            if(i%2==0)
            even = even + i;
            else
            odd = odd + i;
        }
        alert('even=' + even +' odd=' + odd);
    // 输入班级总人数
    // 依次输入成绩，计算成绩之和
    // 计算平均成绩
    var num = prompt('输入班级总人数：')
    var sum = 0;
    var average = 0;
    for (var i = 1; i <= num; i++)
    {
        var grade = parseFloat(prompt('请输入第'+i+'位同学的成绩'));
        sum = sum + grade;
    }
    average = sum / num;
    console.log(sum);
    console.log(average);
    // 打印99乘法表
    var str = '';
    for (var i = 1; i <= 9; i++) {
        for (var j = 1; j <= i; j++) {
            str +=  j + '×' + i + '=' + j * i + '\t';
        }
        str += '\n';
    }
    console.log(str);
    // 个位数是三的数
    var sum = 0;
    for (var i = 1; i<=100 ; i++) {
        if ( i % 10 == 3) {
            console.log(i);
            continue;
        }
        sum += i;
    }
    console.log(sum);
    </script>
</head>
<body>
    
</body>
</html>